from tkinter import *

window = Tk()
window.title("我的第一个tkinter界面！")
window.geometry("300x50")
var = Variable()
var.set("                                ")
flg = False

def MyCallback():
    global flg
    if flg == False:
        flg = True
        var.set("主人你好！我来啦，再点我就消失！")
    else:
        flg = False
        var.set("                                ")
L1 = Label(window,textvariable = var,bg = "yellow",font = ("KaiTi_GB2312",12))
L1.pack()
Button(window,text = "点我试试！",command = MyCallback).pack()
mainloop()
